const webpack = require('webpack');
const path = require('path');
const baseWebpackConfig = require("./webpack.base.config")

module.exports = {
  mode: 'development',
  entry: {
    vendor: ['react', 'react-dom'],  //对应output 中的library
  },
  output: {
    // filename: '[name]_[chunkhash].dll.js', //分离出来的文件名称，一个占位符+hash.dll.js  [name]对应的是entry的library
    filename:'[name].js',
    path: path.join(__dirname, '../dist/dll'), //输出到当前目录下的dll目录
    library: '[name]', //打包后暴露出的库的名字
  },
  plugins: [
    new webpack.DllPlugin({
      // name: '[name]_[hash]', //打包后library.json中的name
      name:'[name]',
      path: path.join(__dirname, '../dist/dll/[name].json'), //打包后生成[name].json的路径
    }),
  ],
};